package com.fay.designPattern.principles.solid;

import java.util.ArrayList;
import java.util.List;

/**
 * @Title:
 * @Description:
 * @Author Fay Wang
 * @Date 2022/3/1 17:35
 * @Version 1.0
 */
public class Alert2 {
    private List<OcpAlertHandler> alertHandlers = new ArrayList<>();

    public void addAlertHandler(OcpAlertHandler alertHandler) {
        this.alertHandlers.add(alertHandler);
    }

    public void check(ApiStatInfo apiStatInfo) {
        for (OcpAlertHandler handler : alertHandlers) {
            handler.check(apiStatInfo);
        }
    }
}
